/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;

import java.sql.*;

/**
 *
 * @author Desarrollador
 */
public class datUsuario {
    public static int VerificarAcceso(String Usuario, 
                                      String Password)throws Exception{
        Connection cn = conexion.getConexion();
         try{
             int Verifica = 0;
             Statement stm = cn.createStatement();
             ResultSet tabla = stm.executeQuery(
                     "SELECT * FROM Usuario WHERE Usuario='"+Usuario+"'"+
                     " AND Password='"+Password+"'");
                     
                     
                if(tabla.next()){
                    Verifica =1;
                }     
                return Verifica;
                
         }catch(Exception e){
             throw e;
         }finally{
             cn.close();
         }
             
             }
         
    
}
